define(function(require){
    var main = require('/static/main.js');
	require('/static/page/jquery.pagination.min.js');
	var m = new main();
	function Cont(){
		this.Fun._init();
	}
	Cont.prototype.Fun = {
        data:{
            Size:'',
            PageNo:1,
            PageSize:20,
            TotalCountPage:'',
            TotalCounts:1,
        },
		_init:function(){
		    this.getList();
		},
		getList:function(){
            m.ajax(m.baseUrl+'/site/cumgetlist','',function(ret){
                if(ret.IsBizSuccess){
                    var str = '';
                    if(ret.Models.length <= 0){

                    }else{
                        ret.Models.forEach(function(v,k){
                            str+='<div class="swiper-slide">\
                                    <div class="case-item">\
                                        <p class="img"><img src="'+v.ImgHost+v.Src+'"></p>\
                                        <div class="case-info">\
                                            <p class="case-company">'+v.CompanyTypeName+'<span></span>'+v.CompanyName+' </p>\
                                            <p class="case-name">'+v.Title+'</p>\
                                            <p class="case-intro">'+v.Description+'</p>\
                                            <p class="case-count">有效转化会员 '+v.FansCnt+'人次</p>\
                                        </div>\
                                    </div>\
                                </div>'
                        })
                    }

                    $('.pro_list').html(str);
                    this.data.TotalCounts = ret.TotalCounts;
                    var total_page = Math.ceil(ret.TotalCounts/this.data.PageSize)
                    $('.item .current').html(ret.TotalCounts);
                    $('.item .now').html(this.data.PageNo);
                    this.data.TotalCountsPage = total_page;
                    $('.item .total_page_num').html(this.data.TotalCountsPage);
                    if(this.data.PageNo == 1){
                        $('.M-box1').pagination({
                            totalData:this.data.TotalCounts,
                            showData:this.data.PageSize,
                            coping:true,
                            callback:this.getCallbackPage,
                        });
                    }
                }
            }.bind(this))
        },


	}
	var a = new Cont();

})